#!/bin/sh

# -----------------------------------------------------------
# Twittero - Powerful Twitter client
# mpc Script for MPD + mpc
# -----------------------------------------------------------
# $author: Facundo M. de la Cruz <fmdlc@code4lfie.com.ar>
# $license: BSD License - $depends: mpd - mpc
# -----------------------------------------------------------

if [[ $(pgrep mpd) ]]; then # Pgrep must be running on localhost
  PLAYING=$(mpc current 2> /dev/null)
  [[ ! -z $PLAYING ]] && printf "%s " $PLAYING || printf "noplaying"
else
  printf "noplaying"
fi

exit $?
